<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateCallCommentTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('call_comment', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('评价用户ID');
            $table->integer('call_id')->default(0)->comment('话单ID');
            $table->string('channel_id', 32)->default('')->comment('频道ID');
            $table->tinyInteger('level')->default(0)->comment('评价级别');
            $table->string('tag', 100)->default('')->comment('评价标签ID');
            $table->string('desc', 200)->default('')->comment('评价详情');
            $table->tinyInteger('call_type')->default(1)->comment('话单类型：1-视频，0-语音');
            $table->tinyInteger('flag')->default(1)->comment('评价状态');
            $table->timestamps();
            $table->index('user_id', 'user_id');
            $table->index('channel_id', 'channel_id');
            $table->index('call_id', 'call_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('call_comment');
    }
}
